//
//  LoaderViewController.m
//  AppleCilent
//
//  Created by Nail Sharipov on 02/04/14.
//  Copyright (c) 2014 Nail Sharipov. All rights reserved.
//

#import "LoaderViewController.h"
#import "ResourceData.h"
#import "SceneManager.h"

@interface LoaderViewController ()

@end

@implementation LoaderViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    ResourceData* loader = [ResourceData getInstance];
    [loader setListener:self];
    [loader load];
    
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

-(void)onLoaded
{
    [[SceneManager getInstance] openScene:@"Main"];
}

-(void)onLoadProgress:(float)percent {
    [self.progressBar setProgress:percent];
}

@end
